home *** CD-ROM | disk | FTP | other *** search
/ Champak 50 / Volume 50 - JOGO DISK .iso / Games / marionettemadness.swf / scripts / __Packages / com / mosesSupposes / fuse / ZigoEngine.as < prev    next >
Text File  |  2007-10-01  |  21KB  |  538 lines

  1. class com.mosesSupposes.fuse.ZigoEngine
  2. {
  3.    static var VERSION = com.mosesSupposes.fuse.FuseKitCommon.VERSION + ", ZigoEngine based on concepts by Ladislav Zigo, laco.wz.cz/tween";
  4.    static var EASING = "easeOutQuint";
  5.    static var DURATION = 1;
  6.    static var TIME_MULTIPLIER = 1;
  7.    static var ROUND_RESULTS = false;
  8.    static var OUTPUT_LEVEL = 1;
  9.    static var AUTOSTOP = false;
  10.    static var SKIP_LEVEL = 0;
  11.    static var _playing = false;
  12.    static var zigoIDs = 0;
  13.    static var prevTimeMult = 1;
  14.    function ZigoEngine()
  15.    {
  16.    }
  17.    static function addListener(handler)
  18.    {
  19.       AsBroadcaster.initialize(com.mosesSupposes.fuse.ZigoEngine);
  20.       com.mosesSupposes.fuse.ZigoEngine.addListener(handler);
  21.    }
  22.    static function removeListener(handler)
  23.    {
  24.    }
  25.    static function isPlaying()
  26.    {
  27.       return com.mosesSupposes.fuse.ZigoEngine._playing;
  28.    }
  29.    static function simpleSetup(shortcutsClass)
  30.    {
  31.       if(arguments.length > 0)
  32.       {
  33.          com.mosesSupposes.fuse.ZigoEngine.register.apply(com.mosesSupposes.fuse.ZigoEngine,arguments);
  34.       }
  35.       _global.ZigoEngine = com.mosesSupposes.fuse.ZigoEngine;
  36.       if(com.mosesSupposes.fuse.ZigoEngine.extensions.fuse != undefined)
  37.       {
  38.          _global.Fuse = com.mosesSupposes.fuse.ZigoEngine.extensions.fuse;
  39.       }
  40.       if(com.mosesSupposes.fuse.ZigoEngine.extensions.fuseFMP != undefined)
  41.       {
  42.          com.mosesSupposes.fuse.ZigoEngine.extensions.fuseFMP.simpleSetup();
  43.       }
  44.       com.mosesSupposes.fuse.ZigoEngine.initialize(MovieClip.prototype,Button.prototype,TextField.prototype);
  45.       if(com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts == undefined)
  46.       {
  47.          com.mosesSupposes.fuse.FuseKitCommon.error("001");
  48.       }
  49.    }
  50.    static function register(classReference)
  51.    {
  52.       if(com.mosesSupposes.fuse.ZigoEngine.extensions == undefined)
  53.       {
  54.          com.mosesSupposes.fuse.ZigoEngine.extensions = {};
  55.       }
  56.       var _loc3_ = "|fuse|fuseItem|fuseFMP|shortcuts|pennerEasing|customEasing|";
  57.       for(var _loc4_ in arguments)
  58.       {
  59.          var _loc2_ = arguments[_loc4_].registryKey;
  60.          if(com.mosesSupposes.fuse.ZigoEngine.extensions[_loc2_] == undefined && _loc3_.indexOf("|" + _loc2_ + "|") > -1)
  61.          {
  62.             com.mosesSupposes.fuse.ZigoEngine.extensions[_loc2_] = arguments[_loc4_];
  63.             if(_loc2_ == "fuseFMP" || _loc2_ == "shortcuts")
  64.             {
  65.                Object(com.mosesSupposes.fuse.ZigoEngine.extensions[_loc2_]).initialize();
  66.             }
  67.          }
  68.       }
  69.    }
  70.    static function initialize(target)
  71.    {
  72.       if(arguments.length > 0)
  73.       {
  74.          com.mosesSupposes.fuse.ZigoEngine.initializeTargets.apply(com.mosesSupposes.fuse.ZigoEngine,arguments);
  75.          if(com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts != undefined)
  76.          {
  77.             com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts.addShortcutsTo.apply(com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts,arguments);
  78.          }
  79.       }
  80.    }
  81.    static function deinitialize(target)
  82.    {
  83.       if(arguments.length == 0 || target == null)
  84.       {
  85.          arguments.push(MovieClip.prototype,Button.prototype,TextField.prototype);
  86.       }
  87.       com.mosesSupposes.fuse.ZigoEngine.deinitializeTargets.apply(com.mosesSupposes.fuse.ZigoEngine,arguments);
  88.       if(com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts != undefined)
  89.       {
  90.          com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts.removeShortcutsFrom.apply(com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts,arguments);
  91.       }
  92.    }
  93.    static function getUpdateInterval()
  94.    {
  95.       return com.mosesSupposes.fuse.ZigoEngine.updateTime;
  96.    }
  97.    static function setUpdateInterval(time)
  98.    {
  99.       if(com.mosesSupposes.fuse.ZigoEngine._playing)
  100.       {
  101.          com.mosesSupposes.fuse.ZigoEngine.setup(true);
  102.          com.mosesSupposes.fuse.ZigoEngine.updateTime = time;
  103.          com.mosesSupposes.fuse.ZigoEngine.setup();
  104.       }
  105.       else
  106.       {
  107.          com.mosesSupposes.fuse.ZigoEngine.updateTime = time;
  108.       }
  109.    }
  110.    static function getControllerDepth()
  111.    {
  112.       return com.mosesSupposes.fuse.ZigoEngine.tweenHolder.getDepth();
  113.    }
  114.    static function setControllerDepth(depth)
  115.    {
  116.       if(depth == null || _global.isNaN(depth) == true)
  117.       {
  118.          depth = 6789;
  119.       }
  120.       if(Object(com.mosesSupposes.fuse.ZigoEngine.tweenHolder).proof != null)
  121.       {
  122.          com.mosesSupposes.fuse.ZigoEngine.tweenHolder.swapDepths(depth);
  123.       }
  124.       else
  125.       {
  126.          com.mosesSupposes.fuse.ZigoEngine.tweenHolder = _root.createEmptyMovieClip("ZigoEnginePulse",depth);
  127.       }
  128.    }
  129.    static function doShortcut(targets, methodName)
  130.    {
  131.       if(com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts == undefined)
  132.       {
  133.          if(com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL > 0)
  134.          {
  135.             com.mosesSupposes.fuse.FuseKitCommon.error("002");
  136.          }
  137.          return null;
  138.       }
  139.       return com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts.doShortcut.apply(com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts,arguments);
  140.    }
  141.    static function doTween(targets, props, endvals, seconds, ease, delay, callback)
  142.    {
  143.       if(com.mosesSupposes.fuse.ZigoEngine.extensions.fuse.addBuildItem(arguments) == true)
  144.       {
  145.          return null;
  146.       }
  147.       if(com.mosesSupposes.fuse.ZigoEngine.TIME_MULTIPLIER != com.mosesSupposes.fuse.ZigoEngine.prevTimeMult)
  148.       {
  149.          com.mosesSupposes.fuse.ZigoEngine.TIME_MULTIPLIER = Math.abs(com.mosesSupposes.fuse.ZigoEngine.TIME_MULTIPLIER);
  150.          if(_global.isNaN(com.mosesSupposes.fuse.ZigoEngine.TIME_MULTIPLIER) == true)
  151.          {
  152.             com.mosesSupposes.fuse.ZigoEngine.TIME_MULTIPLIER = 1;
  153.          }
  154.          if(com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL > 0)
  155.          {
  156.             com.mosesSupposes.fuse.FuseKitCommon.error("016",com.mosesSupposes.fuse.ZigoEngine.TIME_MULTIPLIER);
  157.          }
  158.          com.mosesSupposes.fuse.ZigoEngine.prevTimeMult = com.mosesSupposes.fuse.ZigoEngine.TIME_MULTIPLIER;
  159.       }
  160.       if(com.mosesSupposes.fuse.ZigoEngine.instance == undefined || Object(com.mosesSupposes.fuse.ZigoEngine.tweenHolder).proof == undefined && com.mosesSupposes.fuse.ZigoEngine.updateTime == undefined)
  161.       {
  162.          if(MovieClip.prototype.tween != null && typeof _global.$tweenManager == "object")
  163.          {
  164.             com.mosesSupposes.fuse.FuseKitCommon.error("003");
  165.          }
  166.          com.mosesSupposes.fuse.ZigoEngine.instance = new com.mosesSupposes.fuse.ZManager();
  167.          com.mosesSupposes.fuse.ZigoEngine._playing = false;
  168.       }
  169.       var _loc4_ = com.mosesSupposes.fuse.ZigoEngine.instance.paramsObj(targets,props,endvals);
  170.       var _loc7_ = !(_loc4_.tg[0] == null || _loc4_.tg.length == 0) ? _loc4_.tg : undefined;
  171.       if(_loc4_.pa == undefined || _loc7_ == undefined || arguments.length < 3)
  172.       {
  173.          if(com.mosesSupposes.fuse.ZigoEngine.extensions.fuseItem != null && arguments.length == 1 && typeof arguments[0] == "object")
  174.          {
  175.             return com.mosesSupposes.fuse.ZigoEngine.extensions.fuseItem.doTween(arguments[0]);
  176.          }
  177.          if(com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL > 0)
  178.          {
  179.             if(arguments.length < 3)
  180.             {
  181.                com.mosesSupposes.fuse.FuseKitCommon.error("004",!(arguments.length == 1 && arguments[0] == null) ? String(arguments.length) : "1 (null)",Boolean(com.mosesSupposes.fuse.ZigoEngine.extensions.fuseItem == null));
  182.             }
  183.             else
  184.             {
  185.                com.mosesSupposes.fuse.FuseKitCommon.error("005",_loc7_.toString(),_loc4_.pa.toString());
  186.             }
  187.          }
  188.          return null;
  189.       }
  190.       if(com.mosesSupposes.fuse.ZigoEngine._playing != true)
  191.       {
  192.          com.mosesSupposes.fuse.ZigoEngine.setup();
  193.       }
  194.       if(seconds == null || _global.isNaN(seconds) == true)
  195.       {
  196.          seconds = com.mosesSupposes.fuse.ZigoEngine.DURATION || 1;
  197.       }
  198.       else if(seconds < 0.01)
  199.       {
  200.          seconds = 0;
  201.       }
  202.       seconds *= com.mosesSupposes.fuse.ZigoEngine.TIME_MULTIPLIER;
  203.       if(delay < 0.01 || delay == null || _global.isNaN(delay) == true)
  204.       {
  205.          delay = 0;
  206.       }
  207.       delay *= com.mosesSupposes.fuse.ZigoEngine.TIME_MULTIPLIER;
  208.       var _loc12_ = com.mosesSupposes.fuse.FuseKitCommon.parseCallback(callback,_loc7_,com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL,true);
  209.       var _loc9_ = undefined;
  210.       if(typeof ease == "function")
  211.       {
  212.          if(typeof Function(ease).call(null,1,1,1,1) == "number")
  213.          {
  214.             _loc9_ = Function(ease);
  215.          }
  216.          else if(com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL > 0)
  217.          {
  218.             com.mosesSupposes.fuse.FuseKitCommon.error("014",ease);
  219.          }
  220.       }
  221.       else if(ease == null || ease == "")
  222.       {
  223.          if(com.mosesSupposes.fuse.ZigoEngine.EASING instanceof Function)
  224.          {
  225.             _loc9_ = Function(com.mosesSupposes.fuse.ZigoEngine.EASING);
  226.          }
  227.          else if(com.mosesSupposes.fuse.ZigoEngine.extensions.pennerEasing != undefined)
  228.          {
  229.             ease = com.mosesSupposes.fuse.ZigoEngine.EASING;
  230.          }
  231.       }
  232.       if(typeof ease == "string" && ease != "")
  233.       {
  234.          if(com.mosesSupposes.fuse.ZigoEngine.extensions.pennerEasing[ease] != undefined)
  235.          {
  236.             _loc9_ = com.mosesSupposes.fuse.ZigoEngine.extensions.pennerEasing[ease];
  237.          }
  238.          else if(com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL > 0)
  239.          {
  240.             com.mosesSupposes.fuse.FuseKitCommon.error("006",ease);
  241.          }
  242.       }
  243.       else if(ease instanceof Array)
  244.       {
  245.          if(com.mosesSupposes.fuse.ZigoEngine.extensions.customEasing != undefined)
  246.          {
  247.             _loc12_.extra1 = ease;
  248.             if(typeof ease[0] == "number")
  249.             {
  250.                _loc9_ = com.mosesSupposes.fuse.ZigoEngine.extensions.customEasing.precalced;
  251.             }
  252.             else
  253.             {
  254.                _loc9_ = com.mosesSupposes.fuse.ZigoEngine.extensions.customEasing.fromCurve;
  255.             }
  256.          }
  257.          else if(com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL > 0)
  258.          {
  259.             com.mosesSupposes.fuse.FuseKitCommon.error("015",ease);
  260.          }
  261.       }
  262.       if(typeof _loc9_ != "function")
  263.       {
  264.          _loc9_ = function(t, b, c, d)
  265.          {
  266.             return c * ((t = t / d - 1) * t * t * t * t + 1) + b;
  267.          };
  268.       }
  269.       var _loc6_ = "";
  270.       for(var _loc13_ in _loc7_)
  271.       {
  272.          var _loc3_ = _loc7_[_loc13_];
  273.          if(_loc3_.__zigoID__ == null)
  274.          {
  275.             com.mosesSupposes.fuse.ZigoEngine.initializeTargets(_loc3_);
  276.          }
  277.          else if(com.mosesSupposes.fuse.ZigoEngine.instance.getStatus("locked",_loc3_) == true)
  278.          {
  279.             if(com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL > 0)
  280.             {
  281.                com.mosesSupposes.fuse.FuseKitCommon.error("007",_loc3_._name == undefined ? _loc3_.toString() : _loc3_._name,_loc4_.pa.toString());
  282.             }
  283.             continue;
  284.          }
  285.          var _loc5_ = com.mosesSupposes.fuse.ZigoEngine.instance.addTween(_loc3_,_loc4_.pa,_loc4_.va,seconds,_loc9_,delay,_loc12_);
  286.          _loc6_ = (_loc5_ != null ? _loc5_ + "|" : "|") + _loc6_;
  287.       }
  288.       _loc6_ = _loc6_.slice(0,-1);
  289.       return !(_loc6_ == "" || _loc6_ == "|") ? _loc6_ : null;
  290.    }
  291.    static function removeTween(targs, props)
  292.    {
  293.       com.mosesSupposes.fuse.ZigoEngine.instance.removeTween(targs,props);
  294.    }
  295.    static function isTweening(targ, prop)
  296.    {
  297.       return Boolean(com.mosesSupposes.fuse.ZigoEngine.instance.getStatus("active",targ,prop));
  298.    }
  299.    static function getTweens(targ)
  300.    {
  301.       if(com.mosesSupposes.fuse.ZigoEngine.instance == undefined)
  302.       {
  303.          return 0;
  304.       }
  305.       return Number(com.mosesSupposes.fuse.ZigoEngine.instance.getStatus("count",targ));
  306.    }
  307.    static function lockTween(targ, setLocked)
  308.    {
  309.       com.mosesSupposes.fuse.ZigoEngine.instance.alterTweens("lock",targ,setLocked == true);
  310.    }
  311.    static function isTweenLocked(targ)
  312.    {
  313.       return Boolean(com.mosesSupposes.fuse.ZigoEngine.instance.getStatus("locked",targ));
  314.    }
  315.    static function ffTween(targs, props, suppressEndEvents)
  316.    {
  317.       com.mosesSupposes.fuse.ZigoEngine.instance.alterTweens("ff",targs,props,null,suppressEndEvents);
  318.    }
  319.    static function skipTweenTo(seconds, targs, props)
  320.    {
  321.       com.mosesSupposes.fuse.ZigoEngine.instance.alterTweens("skipTo",targs,props,false,false,seconds);
  322.    }
  323.    static function rewTween(targs, props, pauseFlag, suppressStartEvents)
  324.    {
  325.       com.mosesSupposes.fuse.ZigoEngine.instance.alterTweens("rewind",targs,props,pauseFlag,suppressStartEvents);
  326.    }
  327.    static function isTweenPaused(targ, prop)
  328.    {
  329.       return Boolean(com.mosesSupposes.fuse.ZigoEngine.instance.getStatus("paused",targ,prop));
  330.    }
  331.    static function pauseTween(targs, props)
  332.    {
  333.       com.mosesSupposes.fuse.ZigoEngine.instance.alterTweens("pause",targs,props);
  334.    }
  335.    static function unpauseTween(targs, props)
  336.    {
  337.       com.mosesSupposes.fuse.ZigoEngine.instance.alterTweens("unpause",targs,props);
  338.    }
  339.    static function resumeTween(targs, props)
  340.    {
  341.       com.mosesSupposes.fuse.ZigoEngine.instance.alterTweens("unpause",targs,props);
  342.    }
  343.    static function setColorByKey(targetObj, type, amt, rgb)
  344.    {
  345.       new Color(targetObj).setTransform(com.mosesSupposes.fuse.ZigoEngine.getColorTransObj(type,amt,rgb));
  346.    }
  347.    static function getColorTransObj(type, amt, rgb)
  348.    {
  349.       switch(type)
  350.       {
  351.          case "brightness":
  352.             var _loc3_ = 100 - Math.abs(amt);
  353.             var _loc4_ = amt <= 0 ? 0 : 255 * (amt / 100);
  354.             return {ra:_loc3_,rb:_loc4_,ga:_loc3_,gb:_loc4_,ba:_loc3_,bb:_loc4_};
  355.          case "brightOffset":
  356.             return {ra:100,rb:255 * (amt / 100),ga:100,gb:255 * (amt / 100),ba:100,bb:255 * (amt / 100)};
  357.          case "contrast":
  358.             return {ra:amt,rb:128 - 1.28 * amt,ga:amt,gb:128 - 1.28 * amt,ba:amt,bb:128 - 1.28 * amt};
  359.          case "invertColor":
  360.             return {ra:100 - 2 * amt,rb:amt * 2.55,ga:100 - 2 * amt,gb:amt * 2.55,ba:100 - 2 * amt,bb:amt * 2.55};
  361.          case "tint":
  362.             if(rgb != null)
  363.             {
  364.                var _loc5_ = undefined;
  365.                if(typeof rgb == "string")
  366.                {
  367.                   if(rgb.charAt(0) == "#")
  368.                   {
  369.                      rgb = rgb.slice(1);
  370.                   }
  371.                   rgb = rgb.charAt(1).toLowerCase() == "x" ? rgb : "0x" + rgb;
  372.                }
  373.                _loc5_ = Number(rgb);
  374.                return {ra:100 - amt,rb:(_loc5_ >> 16) * (amt / 100),ga:100 - amt,gb:(_loc5_ >> 8 & 255) * (amt / 100),ba:100 - amt,bb:(_loc5_ & 255) * (amt / 100)};
  375.             }
  376.             break;
  377.       }
  378.       return {rb:0,ra:100,gb:0,ga:100,bb:0,ba:100};
  379.    }
  380.    static function getColorKeysObj(targOrTransObj)
  381.    {
  382.       var _loc1_ = targOrTransObj.ra == undefined ? new Color(targOrTransObj).getTransform() : targOrTransObj;
  383.       var _loc3_ = {};
  384.       var _loc7_ = _loc1_.ra == _loc1_.ga && _loc1_.ga == _loc1_.ba;
  385.       var _loc9_ = _loc1_.rb == _loc1_.gb && _loc1_.gb == _loc1_.bb;
  386.       var _loc5_ = _loc7_ != true ? 0 : 100 - _loc1_.ra;
  387.       if(_loc5_ != 0)
  388.       {
  389.          var _loc6_ = 100 / _loc5_;
  390.          _loc3_.tint = _loc1_.rb * _loc6_ << 16 | _loc1_.gb * _loc6_ << 8 | _loc1_.bb * _loc6_;
  391.          _loc3_.tintPercent = _loc5_;
  392.          var _loc2_ = _loc3_.tint.toString(16);
  393.          var _loc4_ = 6 - _loc2_.length;
  394.          while(true)
  395.          {
  396.             _loc4_;
  397.             if(_loc4_-- <= 0)
  398.             {
  399.                break;
  400.             }
  401.             _loc2_ = "0" + _loc2_;
  402.          }
  403.          _loc3_.tintString = "0x" + _loc2_.toUpperCase();
  404.       }
  405.       if(_loc7_ == true && _loc9_ == true)
  406.       {
  407.          if(_loc1_.ra < 0)
  408.          {
  409.             _loc3_.invertColor = _loc1_.rb * 0.39215686274509803;
  410.          }
  411.          else if(_loc1_.ra == 100 && _loc1_.rb != 0)
  412.          {
  413.             _loc3_.brightOffset = _loc1_.rb * 0.39215686274509803;
  414.          }
  415.          if(_loc1_.ra != 100)
  416.          {
  417.             if(_loc1_.rb == 0 || _loc1_.rb != 0 && 255 * ((100 - _loc1_.ra) / 100) - _loc1_.rb <= 1)
  418.             {
  419.                _loc3_.brightness = _loc1_.rb == 0 ? _loc1_.ra - 100 : 100 - _loc1_.ra;
  420.             }
  421.             if(128 - 1.28 * _loc1_.ra - _loc1_.rb <= 1)
  422.             {
  423.                _loc3_.contrast = _loc1_.ra;
  424.             }
  425.          }
  426.       }
  427.       return _loc3_;
  428.    }
  429.    static function initializeTargets()
  430.    {
  431.       for(var _loc5_ in arguments)
  432.       {
  433.          var _loc4_ = arguments[_loc5_];
  434.          if(_loc4_ == MovieClip.prototype || _loc4_ == Button.prototype || _loc4_ == TextField.prototype || _loc4_ == Object.prototype)
  435.          {
  436.             if(_loc4_.oldAddListener == undefined)
  437.             {
  438.                if(_loc4_ == TextField.prototype)
  439.                {
  440.                   _loc4_.oldAddListener = _loc4_.addListener;
  441.                   _global.ASSetPropFlags(_loc4_,"oldAddListener",7,1);
  442.                }
  443.                _loc4_.addListener = function(o)
  444.                {
  445.                   if(this.__zigoID__ == undefined)
  446.                   {
  447.                      com.mosesSupposes.fuse.ZigoEngine.initializeTargets(this);
  448.                   }
  449.                   if(this instanceof TextField)
  450.                   {
  451.                      Function(this.oldAddListener).call(this,o);
  452.                   }
  453.                   else
  454.                   {
  455.                      this.addListener(o);
  456.                   }
  457.                };
  458.                if(_loc4_ == MovieClip.prototype)
  459.                {
  460.                   _global.ASSetPropFlags(_loc4_,"addListener",7,1);
  461.                }
  462.             }
  463.          }
  464.          else if(_loc4_.__zigoID__ == undefined)
  465.          {
  466.             _loc4_.__zigoID__ = com.mosesSupposes.fuse.ZigoEngine.zigoIDs;
  467.             _global.ASSetPropFlags(_loc4_,"__zigoID__",7,1);
  468.             com.mosesSupposes.fuse.ZigoEngine.zigoIDs = com.mosesSupposes.fuse.ZigoEngine.zigoIDs + 1;
  469.             if(_loc4_._listeners == null || _loc4_.addListener == null)
  470.             {
  471.                AsBroadcaster.initialize(_loc4_);
  472.             }
  473.          }
  474.       }
  475.    }
  476.    static function deinitializeTargets()
  477.    {
  478.       for(var _loc4_ in arguments)
  479.       {
  480.          var _loc3_ = arguments[_loc4_];
  481.          if(_loc3_.__zigoID__ != undefined)
  482.          {
  483.             _global.ASSetPropFlags(_loc3_,"__zigoID__,_listeners,broadcastMessage,addListener,removeListener",0,2);
  484.             delete _loc3_.__zigoID__;
  485.             delete _loc3_._listeners;
  486.             delete _loc3_.broadcastMessage;
  487.             delete _loc3_.addListener;
  488.             delete _loc3_.removeListener;
  489.          }
  490.          if(_loc3_.oldAddListener != undefined)
  491.          {
  492.             _global.ASSetPropFlags(_loc3_,"oldAddListener",0,2);
  493.             _loc3_.addListener = _loc3_.oldAddListener;
  494.             delete _loc3_.oldAddListener;
  495.          }
  496.       }
  497.    }
  498.    static function __mgrRelay(inst, method, args)
  499.    {
  500.       if(inst == com.mosesSupposes.fuse.ZigoEngine.instance)
  501.       {
  502.          Function(com.mosesSupposes.fuse.ZigoEngine[method]).apply(com.mosesSupposes.fuse.ZigoEngine,args);
  503.       }
  504.    }
  505.    static function setup(deinitFlag)
  506.    {
  507.       if(deinitFlag == true)
  508.       {
  509.          com.mosesSupposes.fuse.ZigoEngine._playing = false;
  510.          clearInterval(com.mosesSupposes.fuse.ZigoEngine.updateIntId);
  511.          delete com.mosesSupposes.fuse.ZigoEngine.tweenHolder.onEnterFrame;
  512.          return undefined;
  513.       }
  514.       com.mosesSupposes.fuse.ZigoEngine.instance.cleanUp();
  515.       clearInterval(com.mosesSupposes.fuse.ZigoEngine.updateIntId);
  516.       delete com.mosesSupposes.fuse.ZigoEngine.updateIntId;
  517.       if(com.mosesSupposes.fuse.ZigoEngine.updateTime != null && com.mosesSupposes.fuse.ZigoEngine.updateTime > 0)
  518.       {
  519.          com.mosesSupposes.fuse.ZigoEngine.updateIntId = setInterval(com.mosesSupposes.fuse.ZigoEngine.instance,"update",com.mosesSupposes.fuse.ZigoEngine.updateTime);
  520.       }
  521.       else
  522.       {
  523.          if(Object(com.mosesSupposes.fuse.ZigoEngine.tweenHolder).proof == null)
  524.          {
  525.             com.mosesSupposes.fuse.ZigoEngine.setControllerDepth(6789);
  526.             Object(com.mosesSupposes.fuse.ZigoEngine.tweenHolder).proof = 1;
  527.          }
  528.          var _inst = com.mosesSupposes.fuse.ZigoEngine.instance;
  529.          com.mosesSupposes.fuse.ZigoEngine.tweenHolder.onEnterFrame = function()
  530.          {
  531.             _inst.update.call(_inst);
  532.          };
  533.       }
  534.       com.mosesSupposes.fuse.ZigoEngine._playing = true;
  535.       com.mosesSupposes.fuse.ZigoEngine.instance.now = getTimer();
  536.    }
  537. }
  538.